import {
	websock
} from "./net/websock";
import socket from "./net/socket";

const store = {
	uid: 0,
	token: '',
	userInfo: null,
	departList: null, // 部门列表
	posList: null, // 岗位列表
	contachtList: null, // 联系人列表
	qingjiaList: null
}

export const logout = () => {
	uni.setStorageSync("uid", 0);
	uni.removeStorageSync("token");
	uni.removeStorageSync("userInfo");
	store.uid = 0;
	store.token = "";
	store.userInfo = null;
	store.departList = null;
	store.posList = null;
	store.contachtList = null;

	websock.disconnect();
	socket.close();

	uni.reLaunch({ url: '/pages/login/index' })
}


export default store